#ifndef UI_WIDTHBOX_H
#define UI_WIDTHBOX_H

#include <qcombobox.h>

#include "lx_define.h"
#include "gui_export.h"

/**
 * A combobox for choosing a line width.
 */
class GUI_EXPORT UI_WidthBox: public QComboBox {
    Q_OBJECT

public:
    UI_WidthBox(QWidget* parent=0, const char* name=0);
    UI_WidthBox(bool showByLayer, bool showUnchanged,
                QWidget* parent=0, const char* name=0);
    virtual ~UI_WidthBox();

    LX_Define::LineWidth getWidth() {
        return currentWidth;
    }
    void setWidth(LX_Define::LineWidth w);
    void setLayerWidth(LX_Define::LineWidth w);

    void init(bool showByLayer, bool showUnchanged);

    bool isUnchanged() {
        return unchanged;
    }

private slots:
    void slotWidthChanged(int index);

signals:
    void widthChanged(LX_Define::LineWidth);

private:
    LX_Define::LineWidth currentWidth;
    bool showByLayer;
    bool showUnchanged;
    bool unchanged;
};

#endif

